package cn.edu.abtu.controller;

import cn.edu.abtu.entity.EduVideo;
import cn.edu.abtu.service.EduVideoService;
import cn.edu.abtu.vo.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



@RestController
@CrossOrigin
@RequestMapping("/eduservice/video")
public class EduVideoController {
    /**
     * 服务对象
     */
    @Autowired
    private EduVideoService eduVideoService;

    @PostMapping("/addVideo")
    public ResponseData addVideo(@RequestBody EduVideo eduVideo){
        return eduVideoService.addVideo(eduVideo);
    }

    @DeleteMapping("/deleteVideo/{videoId}")
    public ResponseData deleteVideo(@PathVariable String videoId){
        return eduVideoService.deleteVideo(videoId);
    }

    @PutMapping("/updateVideo")
    public ResponseData updateVideo(@RequestBody EduVideo eduVideo){
        return eduVideoService.updateVideo(eduVideo);
    }

}

